package managesystem;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
 * Log een student uit.
 * 
 * @author h4oxer
 *
 */
public class LogOutStudentServlet extends HttpServlet {
	
	static final long serialVersionUID = 1L;
	/**
	 * Log de student uit.
	 */
	public void doGet(HttpServletRequest req,HttpServletResponse resp){
		HttpSession session = req.getSession();
		String fromMobile= (String) session.getAttribute("fromMobile");
		session.setAttribute("currStud", null);
		try {
			if(fromMobile.equals("true")){
				resp.sendRedirect("/index-mobile.jsp");
			}
			else{
				resp.sendRedirect("/index.jsp");
			}
		} catch (IOException e) {
			
			e.printStackTrace();
		}
	}

}
